<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>合同签收</title>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/product.css">
	<link rel="stylesheet" href="css/select.css">
	<style>
		.content-table-two tbody tr td:nth-child(1){
			width: 105px;
		}
		.content-table-two tbody tr td:nth-child(2){
			width: 90px;
		}
		.content-table-two tbody tr td:nth-child(3){
			width: 45px;
		}
		.content-table-two tbody tr td:nth-child(4){
			width: 45px;		
		}
		.content-table-two tbody tr td:nth-child(5){
			width: 60px;
		}
		.content-table-two tbody tr td:nth-child(6){
			width: 80px;
		}
		.content-table-two tbody tr td:nth-child(7){
			width: 60px;
		}
		.content-table-two tbody tr td:nth-child(8){
			width: 80px;
		}
		.content-table-two tbody tr td:nth-child(9){
			width: 150px;
		}
		.content-table-two tbody tr td:nth-child(10){
			width: 80px;
		}
		.color-operation:hover {
		    text-decoration:underline; 
		    cursor: pointer;
		}
	</style>
</head>
<body>
	<div class="main-content">
		<div class="main-bg">
			<p class="content-title">合同签收</p>
			<div class="content-form">
				<form id = "bindForm">
					<input type = "hidden" value = "0" name = "type" >
					<ul> 
						<li><span class="text-name">快递单号：</span><input type="text" name = "tracknumber"></li>
						<li><span class="text-name">部门名称：</span><input type="text" name = "address"></li>
						<li><span class="text-name">签收状态：</span>
							<select id="single" name = "status">
								<option value="">全部</option>
								<option value="0">已签收</option>
								<option value="1">未签收</option>
								<option value="3">已撤回</option>
							</select></li>
						<li><button class="btn-style-two" onclick = "return false" id = "bindSeach" >搜索</button><i class="btn-operation maleft20">重置</i></li>
					</ul>
				</form>
			</div>
			<div class="content-list">
				<div class="info-list">
					<table  class="content-table-two" bindForm = "bindForm" bindClick = "bindSeach" cellspacing="0" cellpadding="0" datatable = "true" dataAction = "/expressInformation/findList">
						<tbody style = "display:none;">
							<th title = "快递单号" name = "tracknumber" type = "string"></th>
							<th title = "收件人部门" name = "departmentname" type = "string"></th>
							<th title = "签收状态" name = "status" type = "dict" dictType = "expressstatus"></th>
							<th title = "发送数量" name = "sends" type = "string"></th>
							<th title = "创建人" name = "updateBy" type = "string"></th>
							<th title = "创建时间" name = "updateDate" type = "string"></th>
							<th title = "签收人" name = "signBy" type = "string"></th>
							<th title = "签收时间" name = "signDate" type = "string"></th>
							<th title = "备注" name = "remark" type = "string" ></th>
						</tbody>
					</table>
					<!-- <table class="content-table-two" cellspacing="0" cellpadding="0">
						<thead>
							<tr>
								<td>快递单号</td>
								<td>部门名称</td>
								<td>签收状态</td>
								<td>发送数量</td>
								<td>创建人</td>
								<td>创建时间</td>
								<td>签收人</td>
								<td>签收时间</td>
								<td>备注</td>
								<td>操作</td>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td><span class="color-operation" onclick="seeLogistics()">434430999324</span></td>
								<td>信息技术中心</td>
								<td>已签收</td>
								<td>20</td>
								<td>李彤通</td>
								<td>2018-01-12 13:00</td>
								<td>李洪洋</td>
								<td>2018-01-12 13:00</td>
								<td>杭州印刷厂杭州印刷厂</td>
								<td>
									<i class="btn-operation1" onclick="del()">撤销签收</i>
								</td>
							</tr>
							<tr>
								<td><span class="color-operation" onclick="seeLogistics()">434430999324</span></td>
								<td>信息技术中心</td>
								<td>已签收</td>
								<td>20</td>
								<td>李彤通</td>
								<td>2018-01-12 13:00</td>
								<td>李洪洋</td>
								<td>2018-01-12 13:00</td>
								<td>杭州印刷厂杭州印刷厂</td>
								<td>
									<i class="btn-operation1" onclick="del()">撤销签收</i>
								</td>
							</tr>
							<tr>
								<td><span class="color-operation" onclick="seeLogistics()">434430999324</span></td>
								<td>信息技术中心</td>
								<td>未签收</td>
								<td>20</td>
								<td>李彤通</td>
								<td>2018-01-12 13:00</td>
								<td>李洪洋</td>
								<td>2018-01-12 13:00</td>
								<td>杭州印刷厂杭州印刷厂</td>
								<td>
									<i class="btn-operation" onclick="sign()">签收</i>
								</td>
							</tr>
							<tr>
								<td><span class="color-operation" onclick="seeLogistics()">434430999324</span></td>
								<td>信息技术中心</td>
								<td>已签收</td>
								<td>20</td>
								<td>李彤通</td>
								<td>2018-01-12 13:00</td>
								<td>李洪洋</td>
								<td>2018-01-12 13:00</td>
								<td>杭州印刷厂杭州印刷厂</td>
								<td>
									<i class="btn-operation1" onclick="del()">撤销签收</i>
								</td>
							</tr>
							<tr>
								<td><span class="color-operation" onclick="seeLogistics()">434430999324</span></td>
								<td>信息技术中心</td>
								<td>已签收</td>
								<td>20</td>
								<td>李彤通</td>
								<td>2018-01-12 13:00</td>
								<td>李洪洋</td>
								<td>2018-01-12 13:00</td>
								<td>杭州印刷厂杭州印刷厂</td>
								<td>
									<i class="btn-operation1" onclick="del()">撤销签收</i>
								</td>
							</tr>
						</tbody>
					</table> -->
				</div>
			</div>
		</div>
		<!-- <div class="table-pages clearfix">
			<ul class="pages-list">
				<li><a href=""><</a></li>
				<li><a class="menu-active" href="">1</a></li>
				<li><a href="">2</a></li>
				<li><a href="">3</a></li>
				<li><a href="">...</a></li>
				<li><a href="">20</a></li>
				<li><a href="">></a></li>
			</ul>
		</div>	 -->	
	</div>
	<script src="js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
	<script src="js/select.jquery.js"></script>
	<script type="text/javascript" src = "js/util.js"></script>
	<script type="text/javascript" src = "js/table.js"></script>
	<script type="text/javascript" src = "js/allProduct.js"></script>
	<script>
		$(document).ready(function (){//新增
		 });
		function seeLogistics(i){
			var data = $("table").getAllData()[i];
        	parent.setData(data);
			parent.layer.open({
			      type: 2,
			      title: '查看物流',
			      shadeClose: true,
			      shade: 0.2,
			      maxmin: true, //开启最大化最小化按钮
			      area: ['870px', '450px'],
			      content: 'seeLogistics.html'
			});
        }
        function  del(i){
        	var data = $("table").getAllData()[i];
        	var param = new FormData();
        	param.append("id",data.id);
        	parent.layer.confirm('确认撤销签收么？', {
				btn: ['确定','取消'] //按钮
			}, function(){
				$.ajax({
			        type: 'post',
			        url:baseUrl + "/expressInformation/trackSignCancel",
			        contentType: false,  
			        processData: false, 
			        async: false,
			        data:param
				}).done(function(dt){
					if(dt == 0){
						parent.layer.msg("撤销签收失败!");
					}else{
						parent.layer.msg("撤销签收成功!");
						$("table").ECDATable();
					}
				});
			},function(){
				parent.layer.closeAll();
			});
		}
        function qs(i){
        	parent.setData($("table").getAllData()[i]);
        	parent.layer.open({
				type: 2,
				title: '签收',
				shadeClose: true,
				shade: 0.2,
				maxmin: true, //开启最大化最小化按钮
				area: ['870px', '450px'],
				content: 'sign.html',
				end:function(){
					$("table").ECDATable();
				}
  		    });
        }
        function tableCallBack (my){
        	my.find("thead").find("tr").append("<td>操作</td>");
        	var allData = my.getAllData();
        	var $tr = my.find("tbody").eq(1).find("tr");
        	for(var i = 0; i < $tr.length ; i ++){
        		var text = $($tr[i]).find("td").eq(0).text();
        		$($tr[i]).find("td").eq(0).empty().append("<span class=\"color-operation\" onclick=\"seeLogistics(" + i + ")\">" + text + "</span>");
        		if(allData[i].status*1 == 0){
        			$($tr[i]).append("<td><i class=\"btn-operation1\" onclick=\"qs(" + i + ")\">签收</i></td>");
        		}else if(allData[i].status*1 == 1){
        			$($tr[i]).append("<td><i class=\"btn-operation1\" onclick=\"del(" + i + ")\">撤销签收</i></td>");
        		}
        	}
        }
        function getHeight(){
            var myiframeH=$(".main-content").height();
            var _parent=$(window.parent.document);
            _parent.find('body').css('height',(myiframeH+150)+'px');
            _parent.find('.main-position').css('height',(myiframeH+100)+'px');
        };
        $('.main-content').resize(function(){
            getHeight();
        });
	</script>
</body>
</html>